package com.aaa.deadlock;

/**
 * @author C-Q
 * @version 1.1.0
 * @Description: 画板
 * @date 2022/11/1
 */
public class Sketchpad extends Thread{
    @Override
    public void run() {
        synchronized (DeadLock.lock2){
            System.out.println(Thread.currentThread().getName()+"获取画笔");
            synchronized (DeadLock.lock1){
                System.out.println(Thread.currentThread().getName()+"获取画板");
                System.out.println(Thread.currentThread().getName()+"可以画画了");
            }
        }
    }
}
